<template>
  子组件C
  <div class="nav">
    <div class="nanI">
      <!-- 设置具名插槽 -->
      <slot name="left">1</slot>
    </div>
    <div class="nanI">
      <!-- 动态指定slot的名称 -->
      <slot :name="slotName">2</slot>
    </div>
    <div class="nanI">
      <slot name="right">3</slot>
    </div>
    <br />
  </div>
  <span>
    <slot>不指定名字的插槽默认的name=default</slot>
  </span>
</template>

<script>
export default {
  props: ['slotName'],
  methods: {
    btnClick() {
      console.log('子组件被点击了')
    },
  },
}
</script>

<style scoped>
.nav {
  display: flex;
  height: 50px;
  background-color: pink;
  text-align: center;
}
.nanI {
  flex: 1;
  justify-content: space-between;
  border: 5px solid #eee;
}
</style>
